﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Admin/Admin.Master" AutoEventWireup="true" CodeBehind="ProductList.aspx.cs" Inherits="Dac.Admin.ProductList" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
        <div class="page_header">
                <h2><img src="<%=ResolveClientUrl("~") %>images/design/dashboard_icon.png" alt="" title="" /> Товары</h2>
        </div>
            
        <asp:UpdatePanel ID="upMain" runat="server" UpdateMode="Conditional">
        <ContentTemplate>
        	<div class="page_container">
                <div class="button_group_top">  
                    <a class="btn btn-info" href="ProductDetail.aspx">Добавить</a>
                </div>
                <div class="table-responsive">
                <asp:GridView ID="grid" AutoGenerateColumns="false" runat="server" CssClass="table table-bordered table-hover"
                AllowPaging="True" PageSize="20" OnPageIndexChanging="grid_PageIndexChanging" onrowdatabound="grid_RowDataBound">
                <PagerSettings Mode="Numeric" PageButtonCount="4" NextPageText=">" PreviousPageText="<"  FirstPageText="<<" LastPageText=">>"/>
                <Columns>
                    <asp:TemplateField HeaderText="Картинка предпросмотра">
                        <ItemTemplate>
                            <asp:HiddenField ID="hidId" Value='<%#Eval("ProductId")%>' runat="server" />
                            <asp:Image runat="server" ID="imgPreviewImage"/>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Название (рус.)">
                        <ItemTemplate>
                            <asp:Label ID="lblProductNameRu" Text='<%# Eval("ProductNameRu") %>' runat="server" />
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Название (англ.)">
                        <ItemTemplate>
                            <asp:Label ID="lblProductNameEn" Text='<%# Eval("ProductNameEn") %>' runat="server" />
                        </ItemTemplate>
                    </asp:TemplateField>
                                                            
                    <asp:TemplateField HeaderText="Action">
                        <ItemTemplate>
                            <a href='ProductDetail.aspx?pid=<%#Eval("ProductId")%>'>
                                <img src="<%=ResolveClientUrl("~") %>images/design/actions_icon/edit_icon.png" alt="" title="Редактировать" border="0" />
                            </a>
                            <asp:ImageButton runat="server" ImageUrl="~/images/design/actions_icon/delete_icon.gif" ToolTip="Удалить" Style="vertical-align:middle;"
                                ID="lbtnDelete" OnCommand="grid_RowCommand" CommandName="delete" CommandArgument='<%# Eval("ProductId")%>' OnClientClick="return confirm('Удалить товар?')" />
                        </ItemTemplate>
                    </asp:TemplateField>
                </Columns>
                </asp:GridView>
                </div>
            </div>
        </ContentTemplate>
        <Triggers>
        </Triggers>
        </asp:UpdatePanel>
</asp:Content>
